import { colorTypes } from '../color/index.js'
import { treeCurveTypes } from '../algorithm/tree.js'
import { fractalTypes } from '../svg/fractal/fractal.js'
import { transformTypes } from '../math/transform.js'
import { layoutTypes } from '../algorithm/layout.js'
import { patternTypes } from '../svg/registShape.js'
import { labelsTypes } from './labels.js'
import { layoutAngles } from './layout.js'
import { fillPatterns } from '../algorithm/fill.js'
import { mirrorTypes, mirrorRefractions } from '../algorithm/mirror.js'
import { curveTypes } from '../svg/curve.js'
import { pathModeTypes } from './pathMode.js'
import {bottomControlGearTypes} from '../algorithm/sierpinski.js'


export const axisTypes = ['none', 'axis', 'grid', 'polar']


// 默认right 向内 left向外
// export const curveTypes = ['none', 'bezier', 'leftBezier', 'doubleBezier',
//     'sawtooth', 'leftSawtooth', 'doubleSawtooth',
//     'semicircle', 'leftSemicircle', 'circle', 'diamond', 'cross',
//     'triangle', 'leftTriangle', 'rightAngle', 'leftAngle', 'centripetal',
//     'leftCentripetal', 'doubleCentripetal', 'tangentCircle',
//     'sin', 'rough']
// export const mirrorTypes = ['none', 'vertex', 'edge', 'edgeMid', 'radiusMid', 'leftVertex','topVertex']
export const animationTypes = ['none', 'rotate', 'scale', 'skewX', 'skewY', 'translate', 'path']
export const motionTypes = animationTypes
export const motionOrigins = ['centre', 'vertex']




const monocolors = ['none', 'black', 'gray', 'red', 'blue', 'purple', 'green']//,'yellow'
const strokeTypes = monocolors
const fillTypes = monocolors

const fillRuleTypes =['nonzero','evenodd']
export const typesMap = {
    fractalTypes, transformTypes, patternTypes, colorTypes,
    strokeTypes, fillTypes, axisTypes, layoutTypes, treeCurveTypes,
    pathModeTypes, curveTypes, mirrorTypes, animationTypes, motionTypes, motionOrigins,
    labelsTypes,
    layoutAngles,
    fillPatterns,
    mirrorRefractions,
    bottomControlGearTypes,
    fillRuleTypes
}



// 参数顺序 
export const keysOrder = ['shape', 'n', 'r', 'a', 'm',
    'transform', 'pathModel', 'curve',
    'edge', 'vertex', 'centre', 'excircle', 'incircle', 'labels', 'linkCross',
    'radius', 'links',
    'pattern',
    'color', 'colorful', 'alpha', 'fill',
    'props_.*?',
    'axis', 'layout',
    'axiom', 'rules_.*?',
    'props',
    'mirror', 'fractal', 'animation', 'motion'
]
// 默认参数
export const defaultProps = [
    {
        field: 'shape',
        type: 'string',
        disabled: true
    },
    {
        field: 'n',
        type: 'number',
        min: 1,
        max: 999
    }, {
        field: 'r',
        type: 'number',
        min: 1,
        max: 999999
    },
    {
        field: 'a',
        type: 'number',
    },
    {
        field: 'm',
        min: 1,
        max: 999
    }
]
// 多层级属性
export const multiLevelProps = ['color', 'curve', 'edge', 'edgeExtension',
    'vertex', 'centre', 'excircle', 'incircle',
    'labels', 'rules', 'links', 'radius', 'props', 'mirror',
    'fractal', 'animation', 'motion', 'layout', 'axis', 'mark', 'fill']

// 下拉选项字段
export const selectFields = ['fractal', 'transform', 'pattern', 'color', 'stroke',
    'fill', 'axis', 'layout', 'treeCurve', 'pathMode', 'curve', 'mirror',
    'mirror_type', 'mirror_refraction',
    'animation_type', 'motion_type', 'motion_origin', 'curve_type',
    'labels_type', 'color_type', 'layout_type', 'layout_angle', 'axis_type',
    'fill_pattern','bottomControlGear','fillRule']




// 能旋转的图形
// 会自动加角度a参数
export const rotatableShape = ['polygon', 'ray', 'triangle', 'square', 'pentagon', 'hexagon', 'heptagon',
    'spiral', 'polar', 'star', 'leaf', 'gridRect', 'gridPolygon']

// 需要layout和axis的图形
export const layoutableShape = ['polygon', 'ray', 'triangle', 'square', 'pentagon',
    'hexagon', 'heptagon',
    'spiral', 'polar', 'star', 'leaf', 'wanhuachi', 'curve', 'wave',
    'elliptical', 'sin', 'tree', 'plant', 'dragon', 'isometric',
    'koch', 'mitsubishi', 'peano',
    'polarShape', 'spiralShape', 'ringShape', 'rayShape', 'isometricShape', 'polygonShape',
    'lsystem', 'lsystemPlant'
]